Optimal. Leaf size=53 \[ -\frac{a \cos (c+d x)}{d}+\frac{2 b x \sin (c+d x)}{d^2}+\frac{2 b \cos (c+d x)}{d^3}-\frac{b x^2 \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0570932, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {3329, 2638, 3296} \[ -\frac{a \cos (c+d x)}{d}+\frac{2 b x \sin (c+d x)}{d^2}+\frac{2 b \cos (c+d x)}{d^3}-\frac{b x^2 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3329
Rule 2638
Rule 3296
Rubi steps
\begin{align*} \int \left (a+b x^2\right ) \sin (c+d x) \, dx &=\int \left (a \sin (c+d x)+b x^2 \sin (c+d x)\right ) \, dx\\ &=a \int \sin (c+d x) \, dx+b \int x^2 \sin (c+d x) \, dx\\ &=-\frac{a \cos (c+d x)}{d}-\frac{b x^2 \cos (c+d x)}{d}+\frac{(2 b) \int x \cos (c+d x) \, dx}{d}\\ &=-\frac{a \cos (c+d x)}{d}-\frac{b x^2 \cos (c+d x)}{d}+\frac{2 b x \sin (c+d x)}{d^2}-\frac{(2 b) \int \sin (c+d x) \, dx}{d^2}\\ &=\frac{2 b \cos (c+d x)}{d^3}-\frac{a \cos (c+d x)}{d}-\frac{b x^2 \cos (c+d x)}{d}+\frac{2 b x \sin (c+d x)}{d^2}\\ \end{align*}
Mathematica [A] time = 0.0829764, size = 41, normalized size = 0.77 \[ \frac{2 b d x \sin (c+d x)-\left (a d^2+b \left (d^2 x^2-2\right )\right ) \cos (c+d x)}{d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.007, size = 99, normalized size = 1.9 \begin{align*}{\frac{1}{d} \left ({\frac{b \left ( - \left ( dx+c \right ) ^{2}\cos \left ( dx+c \right ) +2\,\cos \left ( dx+c \right ) +2\, \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) }{{d}^{2}}}-2\,{\frac{cb \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{2}}}-\cos \left ( dx+c \right ) a-{\frac{{c}^{2}b\cos \left ( dx+c \right ) }{{d}^{2}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.00949, size = 123, normalized size = 2.32 \begin{align*} -\frac{a \cos \left (d x + c\right ) + \frac{b c^{2} \cos \left (d x + c\right )}{d^{2}} - \frac{2 \,{\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} b c}{d^{2}} + \frac{{\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \,{\left (d x + c\right )} \sin \left (d x + c\right )\right )} b}{d^{2}}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.36923, size = 93, normalized size = 1.75 \begin{align*} \frac{2 \, b d x \sin \left (d x + c\right ) -{\left (b d^{2} x^{2} + a d^{2} - 2 \, b\right )} \cos \left (d x + c\right )}{d^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.699871, size = 65, normalized size = 1.23 \begin{align*} \begin{cases} - \frac{a \cos{\left (c + d x \right )}}{d} - \frac{b x^{2} \cos{\left (c + d x \right )}}{d} + \frac{2 b x \sin{\left (c + d x \right )}}{d^{2}} + \frac{2 b \cos{\left (c + d x \right )}}{d^{3}} & \text{for}\: d \neq 0 \\\left (a x + \frac{b x^{3}}{3}\right ) \sin{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.10924, size = 57, normalized size = 1.08 \begin{align*} \frac{2 \, b x \sin \left (d x + c\right )}{d^{2}} - \frac{{\left (b d^{2} x^{2} + a d^{2} - 2 \, b\right )} \cos \left (d x + c\right )}{d^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]